package io.renren.modules.monitor.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import io.renren.modules.monitor.entity.TMonitorAlarm;
import io.renren.modules.monitor.entity.vo.MonitorAlarmVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * //Add the class description
 *
 * @author lhb
 * @date 2023/6/9
 */
@Mapper
public interface TMonitorAlarmDao extends BaseMapper<TMonitorAlarm> {

    List<MonitorAlarmVO> queryMonitorAlarms();

    List<MonitorAlarmVO> queryMonitorAlarmsByKeySearch(@Param("key") String key);

    @Select("SELECT * FROM t_monitor_alarm WHERE code=#{code} AND event_id=#{eventId}")
    TMonitorAlarm getAlarmByCode(@Param("code") String code, @Param("eventId") int eventId);
    
    @Select("SELECT * FROM t_monitor_alarm WHERE create_time>=#{startTime} AND create_time<=#{endTime}")
    List<MonitorAlarmVO> queryMonitorAlarmsByEventTime(@Param("startTime") String startTime, @Param("endTime") String endTime);

    
}
